<template>
	<view>
		<view class="main" :style="myStyle">
			<view class="rank" v-text="rank"></view>
			<view class="nickName" v-text="nickName"></view>
			<view class="score" v-text="score"></view>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			fontSize:{
				type:String,
				default:'35rpx'
			},
			bkColor:{
				type:String,
				default:'transparent'
			},
			endStyle:{
				type:Boolean,
				default:true
			},
			rank:{
				type:String,
				default:'添加文字'
			},
			nickName:{
				type:String,
				default:'添加文字'
			},
			score:{
				type:String,
				default:'添加文字'
			}
		},
		data(){
			return {
				myStyle:''
			}
		},
		mounted(){
			const that=this;
			for(const index in that['_props']){
				if(index=='endStyle')
					break;
				that['myStyle']+='--'+index+':'+that['_props'][index]+';';
			}
		},
	}
</script>

<style scoped>
	.main{
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		background-color: var(--bkColor);
		font-weight: 600;
		font-size: var(--fontSize);
		text-align: center;
		color: #808080;
	}
	.rank{
		width: 30%;
		word-wrap: break-word;
	}
	.nickName{
		width: 30%;
		word-wrap: break-word;
	}
	.score{
		width: 30%;
		word-wrap: break-word;
	}
</style>
